<template>
  <div id="app">
    <!-- <img alt="Vue logo" src="./assets/logo.png">
    <HelloWorld msg="Welcome to Your Vue.js App"/> -->
  <keep-alive>
    <router-view v-if="$route.meta.keepAlive"/>
  </keep-alive>

  <router-view v-if="!$route.meta.keepAlive"/>


    <!-- 底部导航文件 -->
    <nav-view v-if="isShowNav"/>
  </div>
</template>

<script>
// import HelloWorld from './components/HelloWorld.vue'
// 加载底部导肮组件文件 @会指向src目录
import navView from '@/components/nav.vue'

export default {
  name: 'App',
  components: {
    // HelloWorld
    navView
  },
    // 计算属性
  computed:{
    // 设置一个变量
    isShowNav(){
      // console.log(this.$route.path);    //    /detail
      if(this.$route.path==='/index'||this.$route.path==='/home'||this.$route.path==='/info'||this.$route.path==='/my'){
        return true
      }else{
        return false;
      }
    }
  },
  activated () {
    //再次显示组件页面时，需要
  }
}
</script>


<style lang="less" rel="stylesheet/less">
// 需要下载less-roader模块
//加载公共样式文件
@import './assets/css/base.css';
@import './assets/css/common.css';   //http://192.168.29.109:8080/
/* #app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
} */
</style>
